<template>
  <transition name="modal">
    <div class="c-modal" v-if="isModal">
      <div class="c-modal-head">
        <p class="modal-name">{{ title }}</p>
        <span class="iconfont icon-guanbi" @click="closeModal"></span>
      </div>
      <div class="c-modal-main">
        <slot></slot>
        <div class="tt"></div>
      </div>
      
    </div>
  </transition>
</template>

<script setup>
import { defineProps, defineEmits } from "vue";
const props = defineProps({
  title: {
    default: "留言墙",
  },
  isModal: {
    default: false,
  },
});
const emits = defineEmits(["close"]);
function closeModal() {
  emits("close", "w s dsad");
}
// onMounted(closeModal)
props;
</script>
<style lang="less" scoped>
.modal {
  &-enter {
    &-from {
      transform: translateX(310px);
    }
    &-active {
      transition: all 0.2s easy-out;
    }
    &-to {
      transform: translateX(0px);
    }
  }
  &-leave {
    &-from {
      transform: translateX(0px);
    }
    &-active {
      transition: all 0.2s easy-in;
    }
    &-to {
      transform: translateX(310px);
    }
  }
}
.c-modal {
  width: 310px;
  height: 100%;
  position: fixed;
  right: 0;
  top: 42.5px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(20px);
  transition: all 0.3s;
  .c-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
    .modal-name {
      font-size: 16px;
      color: #202020;
      font-weight: 600;
    }
    .icon-guanbi {
      color: #5b5b5b;
      cursor: pointer;
      padding: 3px;
    }
  }
  .c-modal-main{
      height: 100%;
      overflow-y: auto;
      padding-bottom:95px;
      box-sizing: border-box;
      overflow-x: auto;
      margin: 2px;
  }
  .c-modal-main::-webkit-scrollbar{
      width: 3px;
      height: 3px;
  }

  .c-modal-main::-webkit-scrollbar-thumb{
      border-radius: 4px;
      background: rgba(0,0,0,0.3);
  }
  .c-modal-main::-webkit-scrollbar-track{
      border-radius: 4px;
      background: rgba(0,0,0,0);
  }
}
</style>